#!/bin/bash
board_type_file1=/opt/app_driver/profile/CARRIER_BOARD_TYPE
board_type_file2=/tmp/CARRIER_BOARD_TYPE

if [ -f $board_type_file1 ] && [ -f $board_type_file2 ]
then
	diff $board_type_file1 $board_type_file2 > /dev/null
	if [ $? != 0 ]
	then
		echo "Upgrade package & carrier board does not match!"
		exit 1
	fi
fi

cp /tmp/app_driver.tar.bz2 /opt/app_sav -f
cp /tmp/md5.txt /opt/app_sav -f
sync
sleep 3

#echo 1 > /proc/sys/kernel/sysrq
#echo b > /proc/sysrq-trigger
echo "update success"
